//----------------------------------*-C++-*----------------------------------//
/*!
 * \file   BaseSource.hh
 * \author Jeremy Roberts
 * \date   05/23/2011
 * \brief  BaseSource class definition.
 * \note   Copyright 2011 (C) Jeremy Roberts.  Based on Denovo.
 */
//---------------------------------------------------------------------------//
// $Rev:: 125                                           $:Rev of last commit
// $Author:: j.alyn.roberts@gmail.com                   $:Author of last commit
// $Date:: 2011-09-02 00:41:14 +0000 (Fri, 02 Sep 2011) $:Date of last commit
//---------------------------------------------------------------------------//

#ifndef BASESOURCE_HH
#define BASESOURCE_HH

#include <iostream>

#include "angle/Octant.hh"
#include "tran/Traits.hh"

#include "../utilities/SP.hh"

namespace slabtran
{

//===========================================================================//
/*!
 * \class BaseSource
 * \brief Abstract base class that defines an external source in each
 *        fine mesh.
 *
 *  The public interface for sources we require for external sources
 *  includes
 *   - \ref number_groups
 *   - \ref q_e
 *   - \ref verify
 *
 *  \tparam    D   Dimension.
 */
//===========================================================================//

template <class D>
class BaseSource
{

public:
  //@{
  //! Useful typedefs for classes that use BaseSource
  typedef util::SP<BaseSource<D> >      SP_source;
  typedef typename Octant<D>::Omega     Omega;
  //@}

  /// Constructor.
  BaseSource(){}

  /// Virtual destructor.
  virtual ~BaseSource(){}

  // >>> PUBLIC INTERFACE

  /// Return the number of groups.
  virtual int number_groups() const = 0;

  /*
   *  \brief Get source in particles/cm^3-ster.
   *
   *  \param    cell    Spatial cell of source.
   *  \param    angle   Angle.
   *  \param    g       Group of requested source.
   *  \return           Source for requested cell, angle, and direction.
   *
   */
  virtual double q_e(int cell, const Omega &angle, int g) const = 0;

  /// Verify that the source is assigned.
  virtual bool verify() const = 0;

};

} // end namespace slabtran


#endif // BASESOURCE_HH
//---------------------------------------------------------------------------//
//              end of BaseSource.hh
//---------------------------------------------------------------------------//
